package com.chat.module.client;

import com.comment.pojo.domain.chat.WsMessage;
import com.comment.pojo.domain.chat.UserLinkInfo;
import com.comment.dubbo.service.MessageServiceClient;
import io.netty.channel.ChannelHandlerContext;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;

import static com.chat.config.web.webSocket.SessionConstant.CHANEL_INFO_KEY;

@Slf4j
@DubboService(interfaceClass = MessageServiceClient.class)
public class ClientMessageService1
        implements ClientMessageService , MessageServiceClient
{
    @Override
    public void apply(ChannelHandlerContext ctx, WsMessage wsMessage) {
        UserLinkInfo userLinkInfo = ctx.channel().attr(CHANEL_INFO_KEY).get();
        service1(userLinkInfo, wsMessage);
    }

    @Override
    public void service1(UserLinkInfo userLinkInfo, WsMessage wsMessage) {
    }
}
